﻿package mortal.game.view.copy.expCopy
{
    import Message.Game.*;
    import com.mui.controls.*;
    import com.mui.core.*;
    import com.mui.utils.*;
    import extend.language.*;
    import mortal.common.global.*;
    import mortal.component.gconst.*;
    import mortal.component.window.*;
    import mortal.game.cache.*;
    import mortal.game.manager.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.display.*;
    import mortal.game.view.common.item.*;
    import mortal.mvc.interfaces.*;

    public class ExpCopyPassWin extends ResultBaseWindow
    {
        private var _tips:GTextFiled;
        private var _expItem:BaseItem;
        private var _baseItem:BaseItem;
        private var _enterNum:BitmapNumberText;
        private var _expNum:BitmapNumberText;
        private static var _instance:ExpCopyPassWin;

        public function ExpCopyPassWin(param1:ILayer = null)
        {
            super(param1);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this.pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.ExpCopyAcountTitile, 228, -32, this));
            this.pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.ExpCopyAcountTxt1, 208, 47, this));
            this.pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.ExpCopyAcountTxt2, 273 - 45, 162 - 65, this));
            this.pushUIToDisposeVec(UIFactory.bg(200, 158, 350, 2, this, ImagesConst.SplitLine));
            this._tips = UIFactory.gTextField(Language.getString(35219), 240, 176, 220, 80, this, GlobalStyle.textFormatDanLan, true);
            this._tips.mouseEnabled = false;
            this._enterNum = UIFactory.bitmapNumberText(350, 41, "investmentNum.png", 24, 30, -8, this, 9, BitmapNumberText.Mid);
            this._expNum = UIFactory.bitmapNumberText(390, 106, "GroupTowerFailTipNum.png", 21.35, 33, -5, this, 13);
            var _loc_1:Object = {0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, (:10, ):11, +:12, -:13};
            this._expNum.customCharIndex = _loc_1;
            this._expItem = UICompomentPool.getUICompoment(BaseItem);
            this._expItem.setItemStyle(ItemStyleConst.Big);
            this._expItem.source = GlobalClass.getBitmapData(ImagesConst.ExpBig);
            this._expItem.move(312, 89);
            this.addChild(this._expItem);
            this._baseItem = UICompomentPool.getUICompoment(BaseItem);
            this._baseItem.setItemStyle();
            this._baseItem.itemData = new ItemData(GameConst.TConstExpCopyItemCode);
            this._baseItem.move(390, 176);
            this.addChild(this._baseItem);
            setContentBgSize(370, 160);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._tips.dispose(param1);
            this._tips = null;
            this._expItem.dispose(param1);
            this._expItem = null;
            this._enterNum.dispose(param1);
            this._enterNum = null;
            this._expNum.dispose(param1);
            this._expNum = null;
            this._baseItem.dispose(param1);
            this._baseItem = null;
            super.disposeImpl(param1);
            return;
        }// end function

        public function set data(param1:int) : void
        {
            var _loc_2:* = ClockManager.instance.serverOpenDateNum;
            var _loc_3:* = Cache.instance.copy.expCopy.getExpCopyInfoByDay(_loc_2);
            this._enterNum.text = _loc_3 == null ? ("1") : (_loc_3.enterTimes.toString());
            this._expNum.text = "+" + param1;
            return;
        }// end function

        public static function get instance() : ExpCopyPassWin
        {
            if (_instance == null)
            {
                _instance = new ExpCopyPassWin;
            }
            return _instance;
        }// end function

        public static function get isViewShow() : Boolean
        {
            return _instance && !_instance.isHide;
        }// end function

    }
}
